from selenium import webdriver
import time

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By



drivr= webdriver.Edge()
drivr.maximize_window()

drivr.get('https://www.baidu.com/')
time.sleep(5)

#点击新闻
drivr.find_element(By.LINK_TEXT,'新闻').click()
time.sleep(3)

#切换页面
drivr.switch_to.window(drivr.window_handles[-1])
time.sleep(3)

#点击进入
drivr.find_element(By.PARTIAL_LINK_TEXT,'“投资中国就是投资未来”，习近平这句话含金量十足').click()
time.sleep(3)


